package com.hfzy.ihk.facade.linkcall.enums;

import com.hfzy.ihk.common.facade.CustomEnumType;

import java.util.HashMap;
import java.util.Map;

/**
 * 知识库的用途类型
 * 因为知识库涉及到了单呼、双呼的提示
 * 有些知识库信息 需 区分用途 使用，无法达到公用状态
 * */
public enum  KnowledgeUsageType implements CustomEnumType {

    NORMALCALL("NC", "人工外呼"),
    AICALL("AC", "智能外呼");

    private KnowledgeUsageType(String value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    private String value;

    private String desc;
    @Override
    public String getValue() {
        return value;
    }

    @Override
    public String getDesc() {
        return desc;
    }

    private static Map<String, KnowledgeUsageType> map = new HashMap<>();
    static {
        for (KnowledgeUsageType value : KnowledgeUsageType.values()) {
            map.put(value.getValue(), value);
        }
    }

    public static KnowledgeUsageType fromValue(String value) {
        KnowledgeUsageType ret = map.get(value);
        if (ret != null) {
            return ret;
        } else {
            throw new IllegalArgumentException("No enum const " + KnowledgeUsageType.class + "." + value);
        }
    }
}
